/**
 * 
 */
package net.xfok.ui.dock;

import net.xfok.ui.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;

/**
 * @author howard
 *
 */
public class XDock extends Activity implements OnItemClickListener{
	private static final String TAG="XDock";
	private static final String PKG="net.xfok.ui.dock";
	private ListView mlist;
	public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);  
        mlist=(ListView)findViewById(R.id.main);
        mlist.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,items));
        mlist.setOnItemClickListener(this); 
    }
	
	 static String[] items={"Dock","Dock2"};
	    
	    public void onItemClick(AdapterView<?> parent, View view, int position,
				long id) {
	    	Log.i(TAG, "position="+position);	
			Intent intent=new Intent();
			try{
				intent.setClass(this, Class.forName(PKG+"."+items[position]));
				startActivity(intent);
			}catch(Exception e){
				e.printStackTrace();
			}
		}
}
